/**
 * ProjectLayers.java
 *
 * Copyright (c) 2010 Prj.Manager All Rights Reserved.
 *
 * This source file may not be copied, modified or redistributed,
 * in whole or in part, in any form or for any reason, without the express
 * written consent of Prj.Manager .
 **/

package ro.prjmanager.model;


import javax.persistence.*;

/**
 * This class from the domain model is mapping the table project_layers
 * @author Viorel Tacliciu
 * @version 2
 */

@Table(name="project_layers")
@Entity
public class  ProjectLayers{

    //define attributes that maps all columns of the coresponding table
    //this attribute maps the primary key column ID
    private java.lang.Integer id;
    //this attribute maps an bidirectional association
    //it means that FK_PROJECT_LAYER from table generic_components is a foreign key to ID
    private java.util.List<GenericComponents> fkProjectLayerGenericComponents;
    //this attribute maps the foreign key column FK_PROJECT
    private Projects fkProject;
    //this attribute maps the foreign key column FK_LAYER
    private Layers fkLayer;
    //this attribute maps the column name
    private  java.lang.String  name;
    //end mapping columns

    //define getters and setters with coresponding ejb3 annotation, depending of the type
    //of the relation for the column

    /**
     * Mapping the primary key
     * @return - java.lang.Integer the primary key for this entity
     **/
    @Id
                 @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID")
    public  java.lang.Integer  getId(){
        return this.id;
    }

    /**
     * The setter for ID column
     * @param id -  an java.lang.Integer object
     **/
    public void setId( java.lang.Integer  id){
        this.id=id;
    }
    /**
     * This method maps an OneToMany relation between this table and
     * GenericComponents table
     * @return - an list of GenericComponents objects
     **/
    @OneToMany(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_PROJECT_LAYER",referencedColumnName = "ID") 
    public java.util.List<GenericComponents> getFkProjectLayerGenericComponents(){
        return this.fkProjectLayerGenericComponents;
    }
    
    /**
     * This method sets the field fkProjectLayerGenericComponents of this entity
     * @param fkProjectLayerGenericComponents - an list of GenericComponents objects
     **/
    public void setFkProjectLayerGenericComponents(java.util.List<GenericComponents> fkProjectLayerGenericComponents){
        this.fkProjectLayerGenericComponents=fkProjectLayerGenericComponents;
    }
    /**
     * This method maps an ManyToOne relation between this entity and
     * projects entity
     * @return - an Projects object
     **/
    @ManyToOne(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_PROJECT",referencedColumnName = "ID")
    public Projects getFkProject(){
        return this.fkProject;
    }

    /**
     * This method sets the field fkProject of this entity
     * @param fkProject - an Projects object
     **/
    public void setFkProject(Projects fkProject){
        this.fkProject=fkProject;
    }
    /**
     * This method maps an ManyToOne relation between this entity and
     * layers entity
     * @return - an Layers object
     **/
    @ManyToOne(cascade=CascadeType.REFRESH)
    @JoinColumn(name = "FK_LAYER",referencedColumnName = "ID")
    public Layers getFkLayer(){
        return this.fkLayer;
    }

    /**
     * This method sets the field fkLayer of this entity
     * @param fkLayer - an Layers object
     **/
    public void setFkLayer(Layers fkLayer){
        this.fkLayer=fkLayer;
    }
    /**
     * This method gets the name attribute
     * @return - an  java.lang.String  object
     **/
    @Column(name = "name")
    public  java.lang.String  getName(){
        return this.name;
    }

    /**
     * The setter for name column
     * @param name -  an  java.lang.String  object
     **/
    public void setName( java.lang.String  name){
        this.name=name;
    }
}



